package com.ml.shs.controller;

import com.ml.shs.annotation.LoginAnnotation;
import com.ml.shs.entity.Classify;
import com.ml.shs.repository.ClassifyRepository;
import com.ml.shs.service.ClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/shs/classify")
public class ClassifyController {

    @Autowired
    ClassifyService classifyService;

    @GetMapping("getList")
    public List<Classify> getList() {
       return classifyService.getList();
    }

    @PostMapping("/save")
    @LoginAnnotation(name="没有登陆")
    public String save(@RequestBody Classify classify) {
        classifyService.save(classify);
        return "success";
    }
}
